package com.xiaoq.positionmarket.service.impl;

import com.xiaoq.positionmarket.entity.PositionMarketEntity;
import com.xiaoq.positionmarket.repository.IPositionMarketRepository;
import com.xiaoq.positionmarket.service.IPositionMarketService;
import com.xiaoq.vo.PagingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by chenjh on 2018/4/2.
 */
@Service
public class PositionMarketServiceImpl implements IPositionMarketService {

    @Autowired
    private IPositionMarketRepository positionMarketRepository;

    @Override
    public boolean save(PositionMarketEntity entity) {
        return positionMarketRepository.save(entity);
    }

    @Override
    public PositionMarketEntity getById(String id) {
        return positionMarketRepository.getById(id);
    }

    @Override
    public boolean deleteById(String id) {
        return positionMarketRepository.deleteById(id);
    }

    @Override
    public List<PositionMarketEntity> getPositionMarketListByPage(String shopId, PagingVo pagingVo) {
        return positionMarketRepository.getPositionMarketListByPage(shopId, pagingVo);
    }

    @Override
    public long getPositionMarketCountByPage(String shopId) {
        return positionMarketRepository.getPositionMarketCountByPage(shopId);
    }

    @Override
    public boolean updateById(PositionMarketEntity entity) {
        return positionMarketRepository.updateById(entity);
    }
}
